package com.teamwork.ZuccEcho.Repository;

import com.teamwork.ZuccEcho.Entity.Questionnaire;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Query;

import java.util.List;

public interface ClassFeedBackApiRepository extends JpaRepository<Questionnaire,Long>, JpaSpecificationExecutor<Questionnaire> {
    Questionnaire findById(long id);

    @Query(value="select MAX(qn_id) from questionnaire", nativeQuery = true)
    Long findPublicedQnId();

    @Query(value="select * from questionnaire where qn_id = ?1", nativeQuery = true)
    List<Questionnaire> findQuestionnaireById(long qn_id);
}
